#include<iostream>
#include <pthread.h>
#include <sys/types.h>
#include<unistd.h>

void* threadrou(void* arg)
{
    const char* threadname = (const char*)arg;
    while(true)
    {
        std::cout << threadname << "pid "<<getpid()<<std::endl;
        sleep(1);
    }
}

int main()
{
    pthread_t status;
    int ret = pthread_create(&status,NULL,threadrou,(void*)"i am thread 1");
    while(true)
    {
        std::cout << "i am main thread" <<"pid "<<getpid()<< std::endl;
        sleep(1);
    }
}